package com.pxxy.toturial.entity;

import java.util.Objects;

/******************
 * @Author yejf
 * @Description TODO
 */
public class Memory {

    public Memory() {
        System.out.println("memory空参构造 ");
    }

    public void init() {
        System.out.println("Memory init method()...");
    }

    private Integer id;

    private int capacity; //容量

    private String brand; //品牌

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Memory{");
        sb.append("id=").append(id);
        sb.append(", capacity=").append(capacity);
        sb.append(", brand='").append(brand).append('\'');
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Memory memory = (Memory) o;
        return capacity == memory.capacity &&
                Objects.equals(id, memory.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, capacity);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getCapacity() {
        return capacity;
    }

    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }
}
